#pragma once
#include <vector>

using namespace std;

namespace moveZeroes
{
	class Solution {
	public:
		void moveZeroes(vector<int>& nums) {
			int idx = 0;
			int i = 0;
			for (; i < nums.size(); i++)
			{
				if (nums[i] != 0)
				{
					if (i != idx)
					{
						nums[idx] = nums[i];
					}
					idx++;
				}
			}
			while (idx < nums.size())
			{
				nums[idx] = 0;
				idx++;
			}
		}
	};

}